package com.lmx.repoDomain.tmodel;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import com.lmx.repoDomain.tmodel.business.User;
import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;
/**
 * 回访表
 */
@JsonApiResource(type = "backvist")
@Table(name = "tnb_backvist")
@Entity
public class BackVistInfo extends BaseEntity {

	private String remark;// 备注

	private String content;

	private User lastUpdateUser;// 更新操作者userid

	private Integer createDateTime;// 创建时间

	private User createUser;

	private Integer lastUpdateDateTime;// 更新时间

	private Dicttype backVistType;

	private ConsultInfo consultInfo;

	private Employee vistUser;// 回访人

	private String customerName;

	private String customerTel;

	private Dicttype accessType;// 跟进类别
	
	private Dicttype liveIntent;// 入住意向

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "live_intent", foreignKey = @ForeignKey(name = "null"))
	@Fetch(FetchMode.JOIN)
	public Dicttype getLiveIntent() {
		return liveIntent;
	}

	public void setLiveIntent(Dicttype liveIntent) {
		this.liveIntent = liveIntent;
	}
	
	@Column(name = "customer_tel")
	public String getCustomerTel() {
		return customerTel;
	}

	public void setCustomerTel(String customerTel) {
		this.customerTel = customerTel;
	}

	@Column(name = "customer_name")
	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "accesstype_id", foreignKey = @ForeignKey(name = "null"))
	@Fetch(FetchMode.JOIN)
	public Dicttype getAccessType() {
		return accessType;
	}

	public void setAccessType(Dicttype accessType) {
		this.accessType = accessType;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "vistuser_id", foreignKey = @ForeignKey(name = "null"))
	public Employee getVistUser() {
		return vistUser;
	}

	public void setVistUser(Employee vistUser) {
		this.vistUser = vistUser;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "backvisttype_id", foreignKey = @ForeignKey(name = "null"))
	@Fetch(FetchMode.JOIN)
	public Dicttype getBackVistType() {
		return backVistType;
	}

	public void setBackVistType(Dicttype backVistType) {
		this.backVistType = backVistType;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "consultinfo_id", foreignKey = @ForeignKey(name = "null"))
	@Fetch(FetchMode.JOIN)
	public ConsultInfo getConsultInfo() {
		return consultInfo;
	}

	public void setConsultInfo(ConsultInfo consultInfo) {
		this.consultInfo = consultInfo;
	}

	@Column(name = "createDateTime")
	public Integer getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Integer createDateTime) {
		this.createDateTime = createDateTime;
	}

	@Column(name = "lastUpdateDateTime")
	public Integer getLastUpdateDateTime() {
		return lastUpdateDateTime;
	}

	public void setLastUpdateDateTime(Integer lastUpdateDateTime) {
		this.lastUpdateDateTime = lastUpdateDateTime;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "createuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getCreateUser() {
		return createUser;
	}

	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "lastupdateuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getLastUpdateUser() {
		return lastUpdateUser;
	}

	public void setLastUpdateUser(User lastUpdateUser) {
		this.lastUpdateUser = lastUpdateUser;
	}

	@Column(name = "content")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public BackVistInfo() {
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
